<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>床位查询</title>
</head>
<body>
<div class="easyui-panel" data-options="fit:true,berder:false,onOpen:dynamicqueryBed1" border="none">
	<div class="easyui-layout" data-options="fit:true" >

		<div id="bedquery_btn">
			<span
				style="font-size: 15px; font-weight: bold; font-style: italic; text-decoration: underline;">条件查询：</span>
			<select class="easyui-combobox" prompt="科室" id="bed_query_office"
				data-options="url:'to_QueryLiveOffice',valueField:'text',textField:'text',
				panelMaxHeight:'200px',panelHeight:'auto',width:80,onChange:dynamicqueryBed1">
			</select> <select class="easyui-combobox" prompt="病房类型" id="bed_query_type"
				data-options="url:'to_QueryAllSickroonType',valueField:'typeid',textField:'typename',
				panelHeight:'auto',width:80,onChange:dynamicqueryBed1">
			</select> <select  class="easyui-combobox" prompt="楼号" id="liveBuildID1"
				data-options="url:'to_QueryAllLiveBuild',valueField:'buildId',textField:'name',
				panelHeight:'auto',width:80,onChange:viewfloor1">
			</select> <select class="easyui-combobox" prompt="楼层" id="liveFloor1"
				data-options="valueField:'floorId',textField:'name',onChange:dynamicqueryBed1,
				panelHeight:'auto',width:60,">
			</select> <select class="easyui-combobox" prompt="性别" id="bed_query_sex"
				data-options="onChange:dynamicqueryBed1,
				panelHeight:'auto',width:60,">
				<option></option>
				<option>男</option>
				<option>女</option>
			</select> </select> <select class="easyui-combobox" prompt="状态" id="bed_query_status"
				data-options="onChange:dynamicqueryBed1,
				panelHeight:'auto',width:60,">
				<option></option>
				<option>空闲</option>
				<option>已住</option>
				<option>待打扫</option>
				<option>已锁定</option>
			</select> <a class="easyui-linkbutton" iconCls="icon-search" 
						data-options="onClick:findAllbed">全部病床</a>
		</div>
		
		<div data-options="region:'center'" border='none'
			style="padding: 2px;">
			
			<table class="easyui-datagrid"  id="bed_query_table"
				data-options="singleSelect:true,fitColumns: true, 
						nowrap: false,border:false,fit:true,
						rownumbers:true,toolbar:'#bedquery_btn',
						title:'病房信息',
						pagination:true,pageList: [20],pageSize: 20
				">
				<thead>
					<tr>
						<th data-options="field:'OFFICE',width:40,align:'center'">科室</th>
						<th data-options="field:'SEX2',width:30,align:'center'">性别</th>
						<th data-options="field:'TYPENAME',width:40,align:'center'">类型</th>
						<th data-options="field:'BNAME',width:40,align:'center'">楼号</th>
						<th data-options="field:'FNAME',width:40,align:'center'">楼层</th>
						<th data-options="field:'SICKROOMNAME',width:40,align:'center'">房间号</th>
						<th data-options="field:'BEDNAME',width:40,align:'center'">床位号</th>
						<th data-options="field:'CHARGE',width:30,align:'center'">收费标准</th>
						<th data-options="field:'BEDSTATUS',width:40,align:'center'">状态</th>
						<th data-options="field:'caozuo',width:120,formatter:BeDmanagerHandle,align:'center'">操作</th>
					</tr>
				</thead>
			</table>
		</div>
	</div>

	
	<div id="BedExchangeWindow" class="easyui-window" title="更换床位"
		data-options="collapsible:false,minimizable:false,maximizable:false,
		modal:true,iconCls:'icon-add',closed:true,onOpen:initExchangeBedID"
		style="width: 450px; height: 320px; padding: 2px;">
		<div  class="easyui-layout"
			data-options="fit:true">
			<div data-options="region:'center',href:'to_bed_exchange'"
				style="padding: 1px;"></div>
			<div data-options="region:'south',border:false"
				style="text-align: right; padding: 5px 0 0;">
				<a class="easyui-linkbutton"
					data-options="iconCls:'icon-save', plain:true"
					href="javascript:void(0)" onclick="submitbedExchange_Form()">保存</a>
				<a class="easyui-linkbutton"
					data-options="iconCls:'icon-cancel', plain:true"
					href="javascript:void(0)"
					onclick="javascript: $('#BedExchangeWindow').window('close');$('#bedExchange_Form').form('reset')">取消</a>
			</div>
		</div>
	</div>
	
	<div id="BookFrombedWindow" class="easyui-window" title="病人信息"
		data-options="collapsible:false,minimizable:false,maximizable:false,
		modal:true,iconCls:'icon-add',closed:true,onOpen:initExchangeBedID"
		style="width: 400px; height: 320px; padding: 2px;">
		<div  class="easyui-layout"
			data-options="fit:true">
			<div data-options="region:'center',href:'to_patientInfoFromBed'"
				style="padding: 1px;"></div>
			<div data-options="region:'south',border:false"
				style="text-align: right; padding: 5px 0 0;">
				<a class="easyui-linkbutton"
					data-options="iconCls:'icon-cancel', plain:true"
					href="javascript:void(0)"
					onclick="javascript: $('#BookFrombedWindow').window('close');">取消</a>
			</div>
		</div>
	</div>
</div>

<script type="text/javascript">
	//住院操作按钮
    var BeDmanagerHandle = function(value,row,index){
		var lock;
		if(row.BEDSTATUS=="已锁定"){
			lock="解锁";
		}else{lock="锁定";}
	var btn1 = "<input onclick='bookPatientInfoFromBed(" + index +")' class='bed_query_bt'  type='button' value='查看'>";
	var btn2 = "<input onclick='sweepBed(" + index +")' class='bed_query_bt'  type='button' value='打扫'>";
	var btn3 = "<input onclick='lockBed("+ index +")' class='bed_query_bt'  type='button' value="+ lock +">";
	var btn4 = "<input onclick='openBedExchangeWindow(" + index +")' class='bed_query_bt'  type='button' value='更换床位'>";
	return btn1 + btn2 + btn3 + btn4 ;
	}
</script>

<style type="text/css">
	.bed_query_bt{
	margin: 2px 8px 2px 0px;
	height:25px;
	border-radius: 3px;
	font-size: 14px;
	border: 1px #3366FF solid;
	background: #3399FF;
	color: white;
	}
	</style>
</body>
</html>